import request from '@/utils/request'

// 获取三方机构管理列表数据
export function getListData(data) {
    return request({
        url: '/config/organization/list',
        method: 'get',
        params: data
    })
}

// 获取部门行业下拉数据
export function getDepartPrimaryData() {
    return request({
        url: '/config/organization/industryTreeselect',
        method: 'get'
    })
}

// 获取部门下拉数据（暂时未用到）
export function getDepartmentData(data) {
    return request({
        url: '/szcg/common/dict/getDepts',
        method: 'get',
        params: data
    })
}

// 获取一级行业下拉数据（暂时未用到）
export function getPrimaryData(data) {
    return request({
        url: '/szcg/common/dict/getArchivesIndustryTypeLv1/' + data.id,
        method: 'get'
    })
}

// 获取二级行业下拉数据（暂时未用到）
export function getSecondaryData(data) {
    return request({
        url: '/szcg/common/dict/getArchivesIndustryTypeLv2ByLv1Id/' + data.id,
        method: 'get'
    })
}

// 【新增】三方机构
export function addOrganization(data) {
    return request({
        url: '/config/organization',
        method: 'post',
        data: data
    })
}

// 【编辑】三方机构
export function editOrganization(data) {
    return request({
        url: '/config/organization',
        method: 'put',
        data: data
    })
}

// 【删除】三方机构
export function deleteOrganization(data) {
    return request({
        url: '/config/organization/' + data.id,
        method: 'delete'
    })
}

//获取案件类型
/*export function getcaseType(data) {
    return request({
        url: '/szcg/common/dict/eventType',
        method: 'get'
    })
}*/
export function getcaseType(data) {
    return request({
        url: '/szcg/common/dict/selectSysDict/sbj_type',
        method: 'get'
    })
}

//通过案件类型获取案件大类
export function getcategoryName(data) {
    return request({
        url: '/szcg/common/dict/eventTypelv1/' + data.type,
        method: 'get'
    })
}

//获取小类
export function getsubclassName(data) {
    return request({
        url: '/szcg/common/dict/eventTypelv2/' + data.parentId,
        method: 'get'
    })
}

//获取责任主体列表
export function getresponsible() {
    return request({
        url: '/szcg/common/dict/getParentDepts',
        method: 'get'
    })
}

//获取部门列表
export function getdepartment(data) {
    return request({
        url: '/szcg/common/dict/getDepts',
        method: 'get',
        params:data
    })
}

//获取一级行业列表
export function getprimaryIndustry(deptCode) {
    return request({
        url: '/szcg/common/dict/getArchivesIndustryTypeLv1/' + deptCode,
        method: 'get'
    })
}

//获取二级行业列表
export function getsecondaryIndustry(lv1Id) {
    return request({
        url: '/szcg/common/dict/getArchivesIndustryTypeLv2ByLv1Id/' + lv1Id,
        method: 'get'
    })
}

//获取综合评价表格数据
export function getarchivesTypeLeveList(data){
    return request({
        url:'/archives/archivesTypeLeve/list',
        method:'post',
        data:data
    })
}

//综合评级标准获取二级类
export function getArchivesTypeLeveTwoById(id){
    return request({
        url:'/archives/archivesTypeLeve/getArchivesTypeLeveTwoById/'+id,
        method:'get'
    })
}

//综合评级标准获取二级类表格
export function getArchivesTypeLeveThreeList(id){
    return request({
        url:'/archives/archivesTypeLeve/getArchivesTypeLeveThreeList/'+id,
        method:'get'
    })
}

//新增三级综合评级标准
export function insertArchivesTypeLeveThree(data){
    return request({
        url:'/archives/archivesTypeLeve/insertArchivesTypeLeveThree',
        method:'post',
        data:data
    })
}

//获取三级code
export function getThreeCode(parentId){
    return request({
        url:'/archives/archivesTypeLeve/getThreeCode/'+parentId,
        method:'get',
    })
}

//添加工作实效列表
/*export function getTimesTypeList(){
    return request({
        url:'/szcg/common/dict/getTimesTypeList',
        method:'get',
    })
}*/
export function getTimesTypeList(){
    return request({
        url:'/szcg/common/dict/selectSysDict/times_type',
        method:'get',
    })
}

//添加工作单位列表
/*export function getTimesUnitList(){
    return request({
        url:'/szcg/common/dict/getTimesUnitList',
        method:'get',
    })
}*/
export function getTimesUnitList(){
    return request({
        url:'/szcg/common/dict/selectSysDict/times_unit',
        method:'get',
    })
}

//修改二级综合评价标准
export function saveArchivesTypeLeveTwo(data){
    return request({
        url:'/archives/archivesTypeLeve/saveArchivesTypeLeveTwo',
        method:'put',
        data: data
    })
}

//通过二级类id获取考核明细
export function getArchivesTypeLeveTwoAssessmentList(data){
    return request({
        url:'/archives/archivesTypeLeve/getArchivesTypeLeveTwoAssessmentList/'+data.id,
        method:'get'
    })
}

//新增考核明细
export function addArchivesTypeLeveTwoAssessment(data){
    return request({
        url:'/archives/archivesTypeLeve/addArchivesTypeLeveTwoAssessment',
        method:'post',
        data:data
    })
}

//编辑保存考核明细
export function saveAssessment(data){
    return request({
        url:'/archives/archivesTypeLeve/saveAssessment',
        method:'put',
        data:data
    })
}

//删除考核明细
export function delAssessment(data){
    return request({
        url:'/archives/archivesTypeLeve/delAssessment/'+data.id,
        method:'delete'
    })
}


// 获取三级类图片信息
export function getImageInfo(data) {
    return request({
        url: '/archives/archivesTypeLeve/getImages/' + data.id,
        method: 'get'
    })
}

// 上传三级类图片
export function uploadImageInfo(data) {
    return request({
        url: '/archives/archivesTypeLeve/uploadImage',
        method: 'post',
        data: data
    })
}

// 删除三级类图片
export function deleteImageInfo(data) {
    return request({
        url: '/archives/archivesTypeLeve/delImageById/' + data.id,
        method: 'delete'
    })
}

// 修改三级评价标准保存
export function saveArchivesType(data) {
    return request({
        url: '/archives/archivesTypeLeve/saveArchivesTypeLeveThree',
        method: 'post',
        data: data
    })
}


/****** 案件流程配置相关接口 ******/
// 获取案件流程配置列表数据
export function getProcessList() {
    return request({
        url: '/eventProcessTime/eventProcessTime/list',
        method: 'get'
    })
}

// 获取案件流程配置父级数据
export function getProcessParentList() {
    return request({
        url: '/eventProcessTime/eventProcessTime/getEventProcessTimeParentList',
        method: 'get'
    })
}

// 新增案件流程
export function newAddCaseProcess(data) {
    return request({
        url: '/eventProcessTime/eventProcessTime/add',
        method: 'post',
        data: data
    })
}

// 编辑保存案件流程
export function editCaseProcess(data) {
    return request({
        url: '/eventProcessTime/eventProcessTime/saveEdit',
        method: 'put',
        data: data
    })
}
// 删除案件流程
export function deleteCaseProcess(data) {
    return request({
        url: '/eventProcessTime/eventProcessTime/remove/' + data.id,
        method: 'delete'
    })
}

/*------监理公司管理-----------------------*/
// 获取监理公司列表
export function supervisionList(data) {
    return request({
        url: '/config/supervision/list',
        method: 'get',
        params:data
    })
}

//新增监理公司
export function AddSupervision(data) {
    return request({
        url: '/config/supervision',
        method: 'post',
        data: data
    })
}

//编辑监理公司
export function EditSupervision(data) {
    return request({
        url: '/config/supervision',
        method: 'put',
        data: data
    })
}

//删除监理公司
export function DeleteSupervision(data) {
    return request({
        url: '/config/supervision/'+data.id,
        method: 'delete'
    })
}



//获取案件来源
/*export function geteventSrc() {
    return request({
        url: '/szcg/common/dict/eventSrc',
        method: 'get'
    })
}*/
export function geteventSrc() {
    return request({
        url: '/szcg/common/dict/selectSysDict/szcg_archives_src',
        method: 'get'
    })
}

